﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>


<%
dim rs,sql,i,Page,count,PageCount,kw,listid
dim RndTXT
	const PageSize=10	'每页10

    	kw = qingtian.RepSQL(trim(Request("kw")))
    	Page = Request("page")      '当前页数
    	If Page = "" Then Page = 1
   	If Not IsNumeric(Page) Then Page = 1
    	Page = CLng(Page)
    	If Page < 1 Then Page = 1

	randomize
	RndTXT=int((99999999)*rnd+1)

select case v
case "0"
we0="<br/>"
book1="<input name=""PostField1"" value=""""  emptyok=""true"" /><br/>我要搜<anchor>商品<go href=""search.asp?sid="&sidd&""" method=""post""><postfield name=""kw"" value=""$(PostField1)"" /></go></anchor><br/>"
book="跳到第<input name='Page' format='*N' size='2' maxlength='5'/><a href='search.asp?kw="&server.URLEncode(kw)&"&amp;page=$(Page:n)&amp;sid="&sidd&"'>页</a><br/>"
%>
<card title="搜索商品"><p align="<%=qingtian.px%>">
<%
case "1"
hr="<hr>"
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
book1=""&dao&"<form action=""search.asp?sid="&sidd&""" method=""post""><input name='kw' emptyok=""true"" maxlength='128'/><br/><input type=""submit"" value=""我要搜商品"" /></form>"&we0&""
book=""&dao&"<form action=""search.asp?kw="&server.URLEncode(kw)&"&amp;listid=" & listid & "&amp;sid="&sidd&""" method=""post"">跳到第<input name='Page' format='*N' size='2' maxlength='5'/><input type=""submit"" value=""页"" /></form>"&we0&""
%>
<title>搜索商品</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select

%>
	
<%=connentten%>

<%=we%>搜索.<a href="shangchen.asp?act=1&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">商场</a>.<a href="daolieb.asp?bid=1&amp;act=3&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">礼物</a>.<a href="daolieb.asp?bid=9&amp;act=1&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">道具</a><%=we0%>
<%=book1%>
<%


	if kw<>"" then

	
Set Rs = Server.CreateObject("Adodb.Recordset")
Sql = "select  [nid],[name],[tupic],[paym],[zbit],[zmeili],[ztili],[zjifen],[zvip] from [qingtian_shangpin] where name like '%"&kw&"%' order by [id] desc"
      	rs.open sql,conn,1,1
	if not (rs.bof and rs.eof)  then
			Rs.PageSize = PageSize


			IF Not IsEmpty(Page) Then
				IF Not IsNumeric(Page) Then '判断Page是否为数字
					Page=1
				Else
					Page=Cint(Page) '转换成短整形Integer
				End IF
				IF Page > Rs.PageCount  Then
					Rs.AbsolutePage = Rs.PageCount '设置当前显示页等于最后一页
				ElseIF Page <= 0 Then
					Rs.AbsolutePage = 1 '设置当前页等于第一页
				Else
					Rs.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数
				End IF
			Else
				Rs.AbsolutePage = 1
			End IF
				Page = Rs.AbsolutePage

			%>
			<%=we%>共找到相关标题<%=rs.RecordCount%>条<%=we0%>
			<%
		For i=1 to Rs.PageSize
			If Rs.Eof Then
				exit For
			End If
			%><%
dat=(page-1)*PageSize+i
dat1=dat mod 2
if dat1=0 then
Response.Write we
else
Response.Write sou
end if
%>
<a href="viewdaoju.asp?nid=<%=rs(0)%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs(1))%></a>[<a href="pay.asp?nid=<%=rs(0)%>&amp;sid=<%=sidd%>">购买</a>]<br/>
<% if rs(5)<>0 then %>
魅力:+<%=zi%><%=rs(5)%><%=zi0%>,
<% end if %>
<% if rs(6)<>0 then %>
体力:+<%=zi%><%=rs(6)%><%=zi0%>,
<% end if %>
<% if rs(7)<>0 then %>
积分:+<%=zi%><%=rs(7)%><%=zi0%>,
<% end if %>
<% if rs(4)<>0 then %>
<%=qingtian.bi%>:+<%=zi%><%=rs(4)%><%=zi0%>,
<% end if %>
<% if rs(8)<>0 then %>
vip:+<%=zi%><%=rs(8)%><%=zi0%>个月,
<% end if
Response.Write we0
		Rs.MoveNext
		Next

   	        If rs.PageCount > 1 Then
%>
<%=dao%> 
<%
                end if
    		'分页
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='search.asp?kw="&server.URLEncode(kw)&"&amp;page=" & Page + 1 & "&amp;sid="&sidd&"'>下一页</a>")
    		End If
       
    		If Page > 1 And Page < rs.PageCount Then
    		    Response.Write("|")
    		End If
        
    		If Page > 1 Then
    		    Response.Write("<a href='search.asp?kw="&server.URLEncode(kw)&"&amp;page=" & Page - 1 & "&amp;sid="&sidd&"'>上一页</a>"&we0&"")
    		Elseif rs.PageCount >1 then
    		    Response.Write(""&we0&"")
    		End If
            
    		Randomize()
    
    		If rs.PageCount > 2 Then
    		   %>
		<%=book%>
		<%
    		Response.Write("" & we & "(第" & Page & "/总" & rs.PageCount & "页/共" & rs.RecordCount & "条)" & we0 & "")
    		End If
                                                                



		else

			%>
			<%=we%>没有找到相关标题。<%=we0%>
		<%end if
		Rs.close
		set rs=nothing

		else
			%><%=we%>搜索内容不能为空。<%=we0%><%
		end if
%>
<%=qingtian.qingsav("413")%>
<%=sou%><a href="fans.asp?sid=<%=sidd%>">我的好友</a>|<a href="shangchen.asp?sid=<%=sidd%>">商场</a>|<a href="index.asp?sid=<%=sidd%>">地盘</a><%=we0%>  
<%

End Function
%>
